; /////////////////////////////////////////////////////////////////////////////
;
;     This file is part of PurePicBasic.
; 
;     PurePicBasic is free software: you can redistribute it And/Or modify
;     it under the terms of the GNU General Public License As published by
;     the Free Software Foundation, either version 3 of the License, Or
;     (at your option) any later version.
; 
;     PurePicBasic is distributed in the hope that it will be useful,
;     but WITHOUT ANY WARRANTY; without even the implied warranty of
;     MERCHANTABILITY Or FITNESS For A PARTICULAR PURPOSE.  See the
;     GNU General Public License For more details.
; 
;     You should have received a copy of the GNU General Public License
;     along With PurePicBasic.  If Not, see <http://www.gnu.org/licenses/>.
;
; /////////////////////////////////////////////////////////////////////////////

; /////////////////////////////////////////////////////////////////////////////
; Gestion des erreurs
; /////////////////////////////////////////////////////////////////////////////
Procedure _error_(errorMsg.s,line.i = -1)
  If line = -1
    line = *currentToken\line
  EndIf
  
  errorMsg= ReplaceString(errorMsg,"%l",Str(line)) 
  Debug errorMsg
  Print(errorMsg)
  Exit()
EndProcedure

; /////////////////////////////////////////////////////////////////////////////
; Provoque la sortie du programme
; /////////////////////////////////////////////////////////////////////////////
Procedure Exit(error.i = 0)
  If argDumpSymboleTable
    _dump_symbol_table_()
  EndIf
    
  If argStandAlone
    Repeat : Until Inkey() <> ""
  EndIf
  CloseConsole()
  End error
EndProcedure
; IDE Options = PureBasic 5.10 (Windows - x86)
; CursorPosition = 26
; Folding = -
; EnableXP